package com.ludi.usercenter.controller;

import com.ludi.usercenter.model.domain.request.UserRegisterRequest;
import com.ludi.usercenter.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping(value = "/register")
    public void register(@RequestBody UserRegisterRequest registerRequest){
        String userAccount = registerRequest.getUserAccount();
        String userPassword = registerRequest.getUserPassword();
        String checkPassword = registerRequest.getCheckPassword();
        userService.userRegister(userAccount,userPassword,checkPassword);
    }

}
